package com.yyfax.pay.order.data.dao.protocol;

import com.yyfax.pay.order.model.domain.ProtocolOrderDO;
import org.apache.ibatis.annotations.Param;

public interface ProtocolOrderDao {
	/**
	 * 保存协议支付订单
	 * 
	 * @author wangjwy
	 * @date 2018/6/5 10:56
	 * @since 2.2.0
	 * @param record
	 * @return int
	 * @throws Exception
	 */
	int insert(ProtocolOrderDO record);

	/**
	 * 更新协议支付订单状态
	 * 
	 * @author wangjwy
	 * @date 2018/6/5 11:11
	 * @since 2.2.0
	 * @param busiId, state, originState, respCode, respDesc, thirdOrderId, isNotify
	 * @return int
	 * @throws Exception
	 */
	int modifyState(@Param("busiId") String busiId, @Param("state") Integer state, @Param("originState") Integer originState,
			@Param("respCode") Integer respCode, @Param("respDesc") String respDesc, @Param("thirdOrderId") String thirdOrderId);

	/**
	 * 根据主键查询
	 * 
	 * @author wangjwy
	 * @date 2018/6/7 16:47
	 * @since 2.2.0
	 * @param busiId
	 * @return com.yyfax.pay.order.model.domain.ProtocolOrderDO
	 * @throws Exception
	 */
	ProtocolOrderDO selectByPrimaryKey(@Param("busiId") String busiId);

	/**
	 * 更新状态为已通知
	 * 
	 * @author wangjwy
	 * @date 2018/6/9 10:14
	 * @since 2.2.0
	 * @param busiId, value
	 * @return void
	 * @throws Exception
	 */
	int modifyNotifyState(@Param("busiId") String busiId, @Param("originNotifyState") String originNotifyState, @Param("isNotify") String isNotify);

	/**
	 * 根据商户号和订单号查询
	 * 
	 * @author wangjwy
	 * @date 2018/6/19 14:48
	 * @since 2.2.0
	 * @param merchantCOde, orderId
	 * @return com.yyfax.pay.order.model.domain.ProtocolOrderDO
	 * @throws Exception
	 */
	ProtocolOrderDO selectByMerchantCodeAndOrderId(@Param("merchantCode") String merchantCOde, @Param("orderId") String orderId);
}